package com.daqian.chance.example.admin.modules.member.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqian.chance.example.admin.modules.member.mapper.MemberMapper;
import com.daqian.chance.example.admin.modules.member.po.dto.MemberDTO;
import com.daqian.chance.example.admin.modules.member.po.entity.Member;
import com.daqian.chance.example.admin.modules.member.service.IMemberService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户-信息 服务实现类
 * </p>
 * @author daqian
 * @since 2019-07-25
 */
@Service
@Slf4j
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements IMemberService {

    @Override
    public PageInfo<Member> page(MemberDTO memberDTO) {
        // 开启分页
        PageHelper.startPage(memberDTO.getPageNum(), memberDTO.getPageSize());
        List<Member> memberList = super.list(null);
        // 清除分页
        PageHelper.clearPage();
        return new PageInfo<>(memberList);
    }


}
